CREATE TABLE [dbo].[TCREND_GAST]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[NU_REND_GAST] [dbo].[TD_VC_010] NOT NULL,
[FE_REND_GAST] [dbo].[TD_DT_001] NOT NULL,
[CO_EMPR_DEST] [dbo].[TD_VC_002] NULL,
[AA_OPER_DEST] [dbo].[TD_VC_004] NULL,
[DE_OBSE] [dbo].[TD_VC_100] NULL,
[MM_OPER_DEST] [dbo].[TD_VC_002] NULL,
[CO_BANC_DEST] [dbo].[TD_VC_003] NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TCREND_GA__ST_CO__5D60DB10] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCREND_GA__NU_PR__5F492382] DEFAULT ((0)),
[NU_CNTA_DEST] [dbo].[TD_VC_020] NULL,
[CO_CAJA_DEST] [dbo].[TD_VC_008] NULL,
[NU_COMP_DEST] [dbo].[TD_VC_008] NULL,
[TI_DOCU_ENRE] [dbo].[TD_VC_003] NULL,
[NU_DOCU_ENRE] [dbo].[TD_VC_020] NULL,
[TI_SITU] [dbo].[TD_VC_003] NOT NULL,
[CO_FINA] [dbo].[TD_VC_003] NULL,
[CO_CATE_GAST] [dbo].[TD_VC_020] NULL,
[NU_SOLI] [dbo].[TD_VC_010] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCREND_GA__CO_US__603D47BB] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCREND_GA__FE_US__61316BF4] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCREND_GA__CO_US__6225902D] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCREND_GA__FE_US__6319B466] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCREND_GAST] WITH NOCHECK ADD CONSTRAINT [CK__TCREND_GA__ST_CO__5E54FF49] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TCREND_GAST] ADD CONSTRAINT [PK__TCREND_G__89C688D3459F2B6F] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [NU_REND_GAST], [FE_REND_GAST]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCREND_GAST] ADD CONSTRAINT [FK__TCREND_GA__CO_EM__178E47FC] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
